<template>
	<view>
		<view style="display: flex;justify-content: space-between;align-items: center;flex-wrap:wrap;width: 100%;">
			<view v-for="(item,index) in list" :key="index" style="margin-bottom: 20rpx;width: 49%;"
				@click="goCard('/pages/sub/store/detail?id='+item.id)">
				<view>
					<image :src="item.image"
						style="width:348rpx;height: 348rpx;display: block;border-radius:12rpx 12rpx 0 0;"></image>
					<view style="padding: 20rpx;border-radius: 0 0 12rpx 12rpx;" :style="{backgroundColor:bgcolor}">
						<view
							style="color: #000;font-size: 28rpx;width:100%;overflow:hidden;white-space: nowrap;text-overflow: ellipsis;-o-text-overflow:ellipsis;font-weight: 700;">
							{{item.name}}</view>


						<view style="display: flex;align-items: center;margin-top: 8rpx;">
							<view style="font-size: 24rpx;color: #a9a9a9;margin-right: 10rpx;">报名人数：</view>
							<view style='display: flex;align-items: center;font-size: 24rpx;'>
								<text style="color: #a9a9a9;;">{{item.makeNum}}</text><text
									style="color: #a9a9a9;">/</text><text style="color:#a9a9a9">{{item.people}}</text>
							</view>

						</view>
						<view style="display: flex;align-items: center;margin: 8rpx 0;">
							<view style="font-size:24rpx;color: #a9a9a9;">{{item.beginTime}}</view>
							<view style="font-size: 24rpx;color: #a9a9a9;margin-left: 20rpx;">{{item.week}}</view>
						</view>
						<view style="display: flex;align-items: center;justify-content: space-between;">
							<view style="font-size: 24rpx;color: #a9a9a9;">{{item.city}}</view>
							<view v-if="item.isMake!=null">
								<view
									style="padding: 12rpx 54rpx;background-color:#3277fc;color: #fff;font-size: 22rpx;border-radius: 28rpx;"
									v-if='item.isMake==1&item.statue==0'
									@click.stop="goCard(`/pages/sub/store/application?orderId=${item.orderId}&Id=${item.id}`)">
									报名 </view>
								<view
									style="padding: 10rpx 40rpx;border:2rpx solid #77a4fc;color:#77a4fc;font-size: 22rpx;border-radius: 28rpx;"
									v-if='item.isMake==0&item.statue==0' @click.stop="showTow('你已报名参加,请暂且等待会议开始')">已报名
								</view>
								<view
									style="padding: 10rpx 40rpx;background-color: #b7c3c7;color: #fff;font-size: 22rpx;border-radius: 28rpx;"
									v-if='item.statue==2' @click.stop="showTow('会议已结束了哦,请看看其他会议吧')">已结束</view>
								<view
									style="padding: 10rpx 40rpx;background-color:#fcab32;color: #fff;font-size: 22rpx;border-radius: 28rpx;"
									v-if='item.statue==1' @click.stop="showTow('会议已开始')">进行中</view>
							</view>
							<view v-else>
								<view
									style="padding: 12rpx 54rpx;background-color: red;color: #fff;font-size: 22rpx;border-radius: 28rpx;"
									@click.stop="goCard(`/pages/sub/store/application?orderId=${item.orderId}&Id=${item.id}`)">
									报名 </view>
							</view>
						</view>

					</view>

				</view>
			</view>
		</view>
		<view style="padding: 0 130rpx;">
			<u-divider :text="params.loadTxt" textColor="#b8b8b8" lineColor="#b8b8b8"></u-divider>
		</view>
	</view>
</template>

<script>
	import {
		goNav
	} from '@/lib/Comment.js'
	export default {
		props: {
			list: {
				type: Array,
				default () {
					return []
				}
			},
			params: {
				type: Object,
				default: () => {}
			},
			bgcolor: {
				type: String,
				default: "#fff"
			}
		},
		data() {
			return {

			}
		},
		methods: {
			showTow(text) {
				uni.showToast({
					icon: 'none',
					title: text
				})
			},
			goCard(url, appid) {
				if (appid) {
					uni.navigateToMiniProgram({
						appId: appid,
						path: url,
						envVersion: 'release'
					})
				} else {
					goNav(url)
				}

			},
		}
	}
</script>

<style>
</style>